// import TabsView2 from '@/layouts/tabs/TabsView2';
import TabsView from '@/layouts/tabs/TabsView';
import reportsLayout from '@/layouts/reportsLayout';
import newPageReport from '@/pages/fraMonitoring/components/flightLegDetails/fldReport';
// import PageView from '@/layouts/PageView';
// 自定义icon
import airplane from '@/assets/icon/Fleet_Status_icon.svg';
import eventMonitoring from '@/assets/icon/Event_monitor_normal .svg';
import resourceTools from '@/assets/icon/Resource_tools.svg';
// import reportPanel from '@/assets/icon/Report.svg';
import helpCenter from '@/assets/icon/Help_center.svg';
import date from '@/assets/icon/date.svg';
import ha from '@/assets/icon/ha.svg';
import store from '@/store';
// 无面包屑
// import BlankView from '@/layouts/BlankView';

// 其他路由配置
const otherOption = [
  {
    path: '/login',
    name: '登录页',
    meta: {
      role: 'allow'
    },
    component: () => import('@/pages/login')
  },
  {
    path: '*',
    name: '404',
    meta: {
      role: 'allow'
    },
    component: () => import('@/pages/exception/404')
  },
  {
    path: '/403',
    name: '403',
    meta: {
      role: 'allow'
    },
    component: () => import('@/pages/exception/403')
  },
  {
    path: '/reportsLayout',
    name: '报告',
    meta: {
      sideMenuActive: 'resourceTool',
      icon: 'tool',
      iconTheme: 'filled',
      singlePage: true,
      role: '机队状态'
    },
    component: reportsLayout
  },
  {
    path: '/newPageReport',
    name: '报文',
    meta: {
      sideMenuActive: 'resourceTool',
      icon: 'tool',
      iconTheme: 'filled',
      singlePage: true,
      role: '机队状态'
    },
    component: newPageReport
  },
  {
    path: '/messageUploadGls',
    name: '报文上传-管理供货商',
    meta: {
      sideMenuActive: 'resourceTool',
      icon: 'tool',
      iconTheme: 'filled',
      singlePage: true,
      role: '机队状态'
    },
    component: () => import('@/pages/fraMonitoring/components/messageUpload/gls')
  }

];

export const otherNOption = {
  path: '/',
  name: '首页',
  component: TabsView,
  redirect: '/login',
  children: [
    {
      path: 'taskResearch',
      name: '故障研究 - Research',
      meta: {
        sideMenuActive: 'fraMonitoring',
        customIcon: airplane,
        // paddingTop: '118px',
        role: '机队状态'
      },
      component: () => import('@/pages/fraMonitoring/components/taskResearch')
    }
  ]
};

// 页面路由配置，左侧
export const pageOption = {
  path: '/',
  name: '首页',
  component: TabsView,
  redirect: '/login',
  children: [
    {
      path: 'fraMonitoring',
      name: '机队状态',
      // component: PageView,
      meta: {
        customIcon: airplane,
        // paddingTop: '40px',
        role: '机队状态'
      },
      component: () => import('@/pages/fraMonitoring')
    },
    {
      path: 'eventMonitoring',
      name: '事件监控',
      // component: PageView,
      meta: {
        customIcon: eventMonitoring,
        // paddingTop: '87px',
        role: '事件监控'
      },
      component: () => import('@/pages/eventMonitoring')
    },
    {

      path: 'eventHistory',
      name: '故障历史',
      // component: PageView,
      meta: {

        customIcon: ha,
        // paddingTop: '87px',
        role: '故障历史0'
      },
      component: () => import('@/pages/eventHistory')
    },
    // {
    //   path: 'reportPanel',
    //   name: '报告面板',
    //   // component: PageView,
    //   meta: {
    //     customIcon: reportPanel,
    //     disabled: true,
    //     role: 'allow'
    //   },
    //   component: () => import('@/pages/resourceTool')
    // },
    {
      path: 'resourceTool',
      name: '资源工具',
      // component: PageView,
      meta: {
        customIcon: resourceTools,
        hideAcarsTime: true,
        role: '资源工具'
      },
      component: () => import('@/pages/resourceTool')
    },
    {
      path: 'helpCenter',
      name: '帮助中心',
      // component: PageView,
      meta: {
        invisible: store.state.setting.baseAppNameShow,
        customIcon: helpCenter,
        click: () => {
          store.commit('setting/setState', { key: 'helpFlag', payload: true });
        },
        role: 'allow'
      },
      component: () => import('@/pages/resourceTool')
    }

  ]
};

// 模板版本管理
export const packetPushOther = {
  path: '/',
  name: '首页',
  component: TabsView,
  redirect: '/login',
  children: [
    {
      path: 'packetPush',
      name: '报文配置',
      // component: PageView,
      meta: {
        sideMenuActive: 'resourceTool',
        icon: 'tool',
        iconTheme: 'filled',
        role: '报文推送工作台'
      },
      component: () => import('@/pages/resourceTool/packetPush')
    }
  ]
};

// 报文配置
export const packetPush = {
  path: '/',
  name: '首页',
  component: TabsView,
  redirect: '/login',
  children: [
    {
      path: 'packetPush',
      name: '报文配置',
      // component: PageView,
      meta: {
        sideMenuActive: 'resourceTool',
        icon: 'tool',
        iconTheme: 'filled',
        headerHeight: '60px',
        role: '报文推送工作台'
      },
      component: () => import('@/pages/resourceTool/packetPush'),
      children: [
        {
          path: 'firstClassClassification',
          name: '一级分类管理',
          meta: {
            sideMenuActive: 'resourceTool',
            icon: 'tool',
            iconTheme: 'filled',
            headerHeight: '60px',
            role: '报文推送工作台'
          },
          component: () => import('@/pages/resourceTool/packetPush/firstClassClassification')
        },
        {
          path: 'secondaryClassification',
          name: '二级分类管理',
          meta: {
            sideMenuActive: 'resourceTool',
            icon: 'tool',
            iconTheme: 'filled',
            headerHeight: '60px',
            role: '报文推送工作台'
          },
          component: () => import('@/pages/resourceTool/packetPush/secondaryClassification')
        },
        {
          path: 'groupManagement',
          name: '分组管理',
          meta: {
            sideMenuActive: 'resourceTool',
            icon: 'tool',
            iconTheme: 'filled',
            headerHeight: '60px',
            role: '报文推送工作台'
          },
          component: () => import('@/pages/resourceTool/packetPush/groupManagement')
        },
        {
          path: 'parameterTag',
          name: '参数标签管理',
          meta: {
            sideMenuActive: 'resourceTool',
            icon: 'tool',
            iconTheme: 'filled',
            headerHeight: '60px',
            role: '报文推送工作台'
          },
          component: () => import('@/pages/resourceTool/packetPush/parameterTag')
        },
        {
          path: 'templateManagement',
          name: '模板管理',
          meta: {
            sideMenuActive: 'resourceTool',
            icon: 'tool',
            iconTheme: 'filled',
            headerHeight: '60px',
            role: '报文模板设置'
          },
          component: () => import('@/pages/resourceTool/packetPush/templateManagement')
        }
      ]
    },
    {
      path: 'versionManagement',
      name: '版本管理',
      meta: {
        sideMenuActive: 'resourceTool',
        icon: 'tool',
        iconTheme: 'filled',
        headerHeight: '60px',
        role: '报文模板设置'
      },
      component: () => import('@/pages/resourceTool/packetPush/templateManagement/versionManagement.vue')
    },
    {
      path: 'versionManagementEng',
      name: '版本管理',
      meta: {
        sideMenuActive: 'resourceTool',
        icon: 'tool',
        iconTheme: 'filled',
        headerHeight: '60px',
        role: '报文模板设置'
      },
      component: () => import('@/pages/resourceTool/packetPush/templateManagement/versionManagementEng.vue')
    }
  ]
};

// 故障代码维护
export const resourceTool = {
  path: '/',
  name: '首页',
  component: TabsView,
  redirect: '/login',
  children: [
    // {
    //   path: 'faultCodeMaintenance',
    //   name: '故障代码维护',
    //   meta: {
    //     sideMenuActive: 'resourceTool',
    //     customIcon: resourceTools,

    //     paddingTop: '40px'
    //   },
    //   component: () => import('@/pages/resourceTool/faultCodeMaintenance')
    // },
    {
      path: 'eventTriggerPacketUpload',
      name: '事件触发报文上传',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,

        // paddingTop: '40px',
        role: '事件触发报文上传'

      },
      component: () => import('@/pages/resourceTool/eventTriggerPacketUpload')
    },
    {
      path: 'eventCodeMaintenance',
      name: '事件代码维护',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,

        // paddingTop: '40px',
        role: '事件代码维护'
      },
      component: () => import('@/pages/resourceTool/eventCodeMaintenance')
    },
    {
      path: 'ataPage',
      name: 'ATA章节维护',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,
        // paddingTop: '40px',
        role: 'ATA章节维护'
      },
      component: () => import('@/pages/resourceTool/ataPage')
    },
    {
      path: 'eventHistorySub',
      name: '故障历史',
      // component: PageView,
      meta: {
        customIcon: date,
        // paddingTop: '87px',
        role: '故障历史'
      },
      component: () => import('@/pages/eventHistory')
    },
    {
      path: 'historicalFault',
      name: '历史故障统计',
      // component: PageView,
      meta: {
        customIcon: eventMonitoring,
        // paddingTop: '40px',
        role: '历史故障统计',
        hideAcarsTime: true
      },
      component: () => import('@/pages/faultMonitoring')
    },
    {
      path: 'alertConfig',
      name: 'ALERT代码维护',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,

        // paddingTop: '40px',
        role: 'ALERT代码维护'
      },
      component: () => import('@/pages/resourceTool/alertConfig')
    },
    {
      path: 'repUplinkRequest',
      name: '上行报文模板管理',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,
        // paddingTop: '40px',
        role: '上行模板库'
      },
      component: () => import('@/pages/resourceTool/repUplinkRequest')
    },
    {
      path: 'serviceManagementSettings',
      name: '勤务管理设置',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,
        // paddingTop: '40px',
        role: '勤务管理设置'
      },
      component: () => import('@/pages/resourceTool/serviceManagementSettings')
    },
    {
      path: 'serviceInformation',
      name: '勤务信息',

      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,
        // paddingTop: '38px',
        role: '勤务信息'
      },
      component: () => import('@/pages/resourceTool/serviceInformation')
    },
    {
      path: 'fraMonitoringSetting',
      name: '机队监控',
      meta: {
        sideMenuActive: 'resourceTool',
        icon: 'tool',
        iconTheme: 'filled',
        role: '机队监控',
        hideAcarsTime: true
      },
      component: () => import('@/pages/resourceTool/fraMonitoringSetting')
    },
    {
      path: 'emailNotification',
      name: '邮件通知',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,
        // paddingTop: '40px',
        hideAcarsTime: true,
        role: '邮件通知/ahm提醒应用'
      },
      component: () => import('@/pages/resourceTool/emailNotification')
    },
    {
      path: 'createNewEmail',
      name: '新建邮件',
      meta: {
        sideMenuActive: 'resourceTool',
        icon: 'tool',
        iconTheme: 'filled',
        role: '邮件通知/ahm提醒应用',
        // paddingTop: '100px',
        customIcon: resourceTools,
        hideAcarsTime: true
      },
      component: () => import('@/pages/resourceTool/createNewEmail')
    },
    {
      path: 'wingEngineAndApuInformation',
      name: '在翼发动机及APU信息',
      meta: {
        sideMenuActive: 'resourceTool',
        icon: 'tool',
        iconTheme: 'filled',
        role: '邮件通知/ahm提醒应用',
        // paddingTop: '40px',
        customIcon: resourceTools,
        hideAcarsTime: true
      },
      component: () => import('@/pages/resourceTool/wingEngineAndApuInformation')
    }
  ]
};

const userSetting = {
  path: '/',
  name: '首页',
  component: TabsView,
  redirect: '/login',
  children: [
    {
      path: 'users',
      name: '用户',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,
        // paddingTop: '40px',
        role: '用户列表',
        hideAcarsTime: true
      },
      component: () => import('@/pages/userSetting/users')
    },
    {
      path: 'eventControl',
      name: '事件管控',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,
        // paddingTop: '40px',
        role: '用户列表',
        hideAcarsTime: true
      },
      component: () => import('@/pages/userSetting/eventControl')
    },
    {
      path: 'soundTips',
      name: '提示音',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,
        // paddingTop: '40px',
        role: '用户列表',
        hideAcarsTime: true
      },
      component: () => import('@/pages/ringstone')
    },
    {
      path: 'roles',
      name: '角色',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,
        // paddingTop: '40px',
        role: '角色',
        hideAcarsTime: true
      },
      component: () => import('@/pages/userSetting/roles')
    },
    // {
    //   path: 'userAirplaneRelation',
    //   name: '用户与飞机关系',
    //   meta: {
    //     sideMenuActive: 'resourceTool',
    //     customIcon: resourceTools,
    //     // paddingTop: '40px',
    //     role: '用户与飞机关系',
    //     hideAcarsTime: true
    //   },
    //   component: () => import('@/pages/userSetting/userAirplaneRelation')
    // },
    {
      path: 'AHMBenefit',
      name: 'AHM Benefit信息维护',
      meta: {
        sideMenuActive: 'resourceTool',
        customIcon: resourceTools,
        // paddingTop: '40px',
        role: '角色',
        hideAcarsTime: true
      },
      component: () => import('@/pages/userSetting/AHMBenefit')
    },
  ]
};

const options = {
  mode: 'history',
  base: process.env.VUE_APP_ROUTE_BASE_URL,
  routes: [
    ...otherOption,
    pageOption,
    packetPushOther,
    packetPush,
    // sendAMessage,
    // automaticTransceiverPacketStatistics,
    resourceTool,
    otherNOption,
    userSetting
  ]
};

export default options;
